function bubbleSortReform(arr) {
    let len = arr.length;
    let i = 0;
    let jump = 1;
    for (i; i < len - 1; i = i + jump){
        jump = 1;
        for (let j = 0; j < len - i - 1; j++){
            if (arr[j] > arr[j + 1]){
                let temp = arr[j];
                arr[j] = arr[j + 1];
                arr[j + 1] = temp;
                jump = 1;
            }else{
                jump = jump + 1;
            }
        }
    }
    console.log(arr)
}

bubbleSortReform([12,3,42,32,213,2,3,41,232,34,54,657,67,3456,5000,5001,5002])
